#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define kMaxSize 1000
#define ErrorCode -1

typedef struct BigIntNode *BigInt;
struct BigIntNode {
    int digits[kMaxSize]; /* 各位数字从低位到高位顺次存储 */
    int length; /* 位数 */
    int sign; /* 正负 */
};

int max(int x, int y) {
    return (x > y) ? x : y;
}

BigInt ReadBigInt();
BigInt BigIntAdd(BigInt a, BigInt b);

int main(void) {
    BigInt a, b, c;
    int i;

    a = ReadBigInt();
    b = ReadBigInt();
    c = BigIntAdd(a, b);
    for (i = c->length - 1; i >= 0; i--) {
        printf("%d", c->digits[i]);
    }

    return 0;
}

/* 算法2-10：大整数相加运算  BigIntAdd( a, b ) */
BigInt BigIntAdd(BigInt a, BigInt b) {
    /* 注意：此函数只处理 a+b>0 的情况 */
    BigInt c;
    int i, x, y, carry;

    c = (BigInt)malloc(sizeof(struct BigIntNode));
    c->sign = 1; /* 需要保证a+b>0 */
    c->length = max(a->length, b->length); /* 位数对齐 */
    carry = 0; /* 进位/借位值初始化为0 */
    for (i = 0; i < c->length; i++) {
        if (i < a->length) {
            x = a->sign * a->digits[i];
        } else {
            x = 0; /* 最高位补0 */
        }
        if (i < b->length) {
            y = b->sign * b->digits[i];
        } else {
            y = 0; /* 最高位补0 */
        }
        c->digits[i] = x + y + carry; /* 计算第i位加法 */
        if (c->digits[i] >= 10) { /* 处理进位 */
            carry = 1;
            c->digits[i] -= 10;
        } else if (c->digits[i] < 0) { /* 处理借位 */
            carry = -1;
            c->digits[i] += 10;
        } else {
            carry = 0;
        }
    }
    if (carry > 0) { /* 加法导致最高位产生进位 */
        if (c->length == kMaxSize) {
            printf("错误：位数超限。\n");
            c->length = ErrorCode;
        } else {
            c->digits[c->length] = carry;
            c->length++;
        }
    }
    /* 消除减法导致高位出现的前导0 */
    while ((c->length > 0) && (c->digits[c->length - 1] == 0)) {
        c->length--;
    }
    return c;
}
/* 算法2-10 结束 */

BigInt ReadBigInt() {
    int i, j, n;
    BigInt x;
    char s[kMaxSize + 2];

    x = (BigInt)malloc(sizeof(struct BigIntNode));
    scanf("%s", s);
    n = strlen(s);
    i = 0;
    if (s[0] == '-') {
        x->sign = -1;
        x->length = n - 1;
        i++;
    } else {
        x->sign = 1;
        x->length = n;
    }
    if (x->length > kMaxSize) {
        printf("错误：位数超限。\n");
        x->length = ErrorCode;
    } else {
        j = x->length - 1;
        while (s[i] != '\0') {
            x->digits[j] = s[i] - '0';
            i++;
            j--;
        }
        if (x->digits[x->length - 1] == 0) {
            x->length = 0; /* 0做特殊处理 */
        }
    }
    return x;
}